*******************************
*******************************
** 
** This file replicates most of the results from 
** "Nonpartisan Ballots and the Partisanship of Who Serves in Office"
** by Daniel M. Butler, Adam Dynes, and Michelle Torres
** 
** Note: This file uses the data aggregated to the city level. 
** We are willing to share the underlying individual level data 
** for research projects by academics. If you are interested in 
** getting access to that data, you need to reach out direclty
** to the authors with a description of what you plan to use it for.
**
*******************************
*******************************

** Change working director to where the data file is
** Call up Data
use "PublicData-Nonpartisan Ballots.dta", clear

*******************************
*******************************
**
** Here is a description of some of the key variables used in the analysis:
**
** NB: THE FOLLOWING ARE ALL BASED ON AGGREGATED DATA FROM THE L2 VOTER FILE
** L2_coun_or_mayor_rep = Number of councilors and mayor (if city has a mayor) who L2 classifies as Republican 
** L2_coun_or_mayor_dem = Number of councilors and mayor (if city has a mayor) who L2 classifies as Democratic  
** L2_coun_or_mayor_ind = Number of councilors and mayor (if city has a mayor) who L2 classifies as Independent 
** L2_coun_or_mayor_count = Total number of councilors and mayor (if city has a mayor) matched to L2 voter file
** percRepubs = Percent of partisan city (i.e., excludes independents) officials who are Republican [percRepubs= (L2_coun_or_mayor_rep/(L2_coun_or_mayor_rep + L2_coun_or_mayor_dem))*100]
** percInds = Percent of city officials who are independents [percInds= (L2_coun_or_mayor_ind/(L2_coun_or_mayor_rep + L2_coun_or_mayor_dem+ L2_coun_or_mayor_ind))*100]
** Repub_mayor = 1 if Republican mayor, 0 if a Democratic mayor
** Ind_mayor = 1 if Independent mayor, 0 if Republican or Democrat
** L2_2016_r_count = Number of Voters in the city who L2 identified as Republicans
** L2_2016_d_count = Number of Voters in the city who L2 identified as Democrats
** RepublicanVoterShare = Percent of partisan voters (excludes independents) who are Republican [RepublicanVoterShare=(L2_2016_r_count/(L2_2016_r_count+L2_2016_d_count))*100]
** congruence = 100-abs(percRepubs-RepublicanVoterShare). [i.e., the closeness of the match between the percent Republican among officials versus voters]
**
** NB: THE FOLLOWING GIVE INFORMATION THAT WE COLLECTED ABOUT CITY LEVEL INSTITUTIONS
** election_nonpartisan = City has nonpartisan elections
** oncycle_election = City has elections at the same time as state or national elections
** all_at_large = Dummy variable that equals 1 if  all the city officials are elected in at-large elections
** form_of_govt = Form of Government (mayor-council, council-manager, commissioner, town meeting)
** f_commissioner = Indicator Variable that Form of Government is Commission
** f_council = Indicator Variable that Form of Government is Council-Manager
** f_town = Indicator Variable that Form of Government is Town Meeting
***** [NB: The omitted form of government is Mayor-Council]
**
** NB: THE FOLLOWING ARE ALL BASED ON CITY LEVEL DATA FROM THE 2016 AMERICAN COMMUNITY SURVEY
** ACS16_pct_unempl = Percent unemployed
** ACS16_total_population = Total Population
** ACS16_logpop = log(population)
** ACS16_median_age = Median age
** ACS16_pct_white = Percent who identify as white
** ACS16_pct_black = Percent who identify as black
** ACS16_pct_latino = Percent who identify as Latino
** ACS16_pct_homeown = Percent of households who own home
** median_inc = Median household income
**
** NB: OTHER
** TW_repubshare_pres16 = The Republican Two Party Vote Share in the 2016 Presidential Election (from Tausanovitch and Warshaw)
** coun_or_mayor_count = The number of councilors/mayors that we identified during our data collection (see Table A2)
**
** NB: INFORMATION ABOUT THE LOCATION - The following are fips codes or other place identifiers
** st citytype city city_directory_name fipsoverall fipsstate fips_state fipscounty fipscounty_old fips_county fipsplace fips_place fips_mcd fipscousub fipsconcit fips_cons cityname state countyprimary countyprimaryfips primarycousub
**
*******************************
*******************************
 

************************
** Figure 1: Validating that the L2-based partisanship measure is capturing Partisan Leanings

*2016 Presidential Election
corr TW_repubshare_pres16 RepublicanVoterShare

twoway (scatter TW_repubshare_pres16 RepublicanVoterShare, msize(vtiny) mcolor(%80)) (lowess TW_repubshare_pres16 RepublicanVoterShare,  lpattern(dash) lcolor(black)) (line percRepubs percRepubs, sort lpattern(solid) lcolor(black)),  xtitle(Republican Leaning of City (L2-measure), size(medlarge)) ytitle(2016 Presidential Republican Vote Share, size(medlarge)) legend(off)graphregion(fcolor(white) ifcolor(white))  plotregion(margin(zero)) ylabel(0(20)100) aspectratio(1) xsize(5) ysize(5) text(95 20 "Correlation = 0.83", size(medium) place(e))

gr export "VoterShare_v_PresVote.png", replace


***********************
** Results
***********************


************************
** Figure A4: : Relationship between Registered Voters’ and Municipal Officials’ Partisanship by Partisan Ballot Status

twoway (lowess percRepubs RepublicanVoterShare if election_nonpartisan==1,  lpattern(longdash_dot) lcolor(cranberry) xline(50))  (lowess percRepubs RepublicanVoterShare if election_nonpartisan==0,  lpattern(shortdash) lcolor(ebblue)) (line percRepubs percRepubs, sort lpattern(solid) lcolor(black)),  xtitle(% Registered Voters = Republicans, size(medlarge)) ytitle(% Officials = Republicans, size(medlarge)) legend(off) ylabel(0(10)100) xlabel(0(10)100) aspectratio(1) xsize(5) ysize(5) text(10 18 "Partisan" "Elections", color(ebblue) placement(se)) text(43 33 "Non-Partisan" "Elections", color(cranberry) placement(sw)) name("main", replace)

	graph export "voters-officials-partisanship-by-ballot-type.pdf", replace

	
************************
** Table 2 + (Table A5): Main Regression Results 

** DV: Percent Republicans
xi: reg percRepubs election_nonpartisan RepublicanVoterShare oncycle_election all_at_large f_commissioner f_council f_town ACS16_pct_homeown median_inc ACS16_pct_unempl ACS16_logpop ACS16_median_age ACS16_pct_white ACS16_pct_black ACS16_pct_latino [aweight=ACS16_logpop]if RepublicanVoterShare>50 
	outreg2 using "MainRegression.doc", ctitle("Republican Cities") alpha(.05) symbol(*) dec(2) label replace 

	gen inreg=1 if e(sample)

xi: reg percRepubs election_nonpartisan RepublicanVoterShare oncycle_election all_at_large f_commissioner f_council f_town ACS16_pct_homeown median_inc ACS16_pct_unempl ACS16_logpop ACS16_median_age ACS16_pct_white ACS16_pct_black ACS16_pct_latino [aweight=ACS16_logpop]if RepublicanVoterShare<50
	outreg2 using "MainRegression.doc", ctitle("Democratic Cities") alpha(.05) symbol(*) dec(2) label append

	replace inreg=1 if e(sample)

** DV: Percent Independents
xi: reg percInds election_nonpartisan RepublicanVoterShare oncycle_election all_at_large f_commissioner f_council f_town ACS16_pct_homeown median_inc ACS16_pct_unempl ACS16_logpop ACS16_median_age ACS16_pct_white ACS16_pct_black ACS16_pct_latino [aweight=ACS16_logpop]if RepublicanVoterShare>50
	outreg2 using "MainRegression.doc", ctitle("Republican Cities") alpha(.05) symbol(*) dec(2) label append	

	replace inreg=1 if e(sample)


xi: reg percInds election_nonpartisan RepublicanVoterShare oncycle_election all_at_large f_commissioner f_council f_town ACS16_pct_homeown median_inc ACS16_pct_unempl ACS16_logpop ACS16_median_age ACS16_pct_white ACS16_pct_black ACS16_pct_latino [aweight=ACS16_logpop]if RepublicanVoterShare<50
	outreg2 using "MainRegression.doc", ctitle("Democratic Cities") alpha(.05) symbol(*) dec(2) label append	

	replace inreg=1 if e(sample)


	
****************************************
** Table A6. Robustness Check: Subset - Only Cities where city council elected at large

** DV: Percent Republicans
xi: reg percRepubs election_nonpartisan RepublicanVoterShare oncycle_election f_commissioner f_council f_town ACS16_pct_homeown median_inc ACS16_pct_unempl ACS16_logpop ACS16_median_age ACS16_pct_white ACS16_pct_black ACS16_pct_latino [aweight=ACS16_logpop] if RepublicanVoterShare>50 & all_at_large==1
	outreg2 using "AtLarge.doc", ctitle("Republican Cities") alpha(.05) symbol(*) dec(2) label replace

xi: reg percRepubs election_nonpartisan RepublicanVoterShare oncycle_election f_commissioner f_council f_town ACS16_pct_homeown median_inc ACS16_pct_unempl ACS16_logpop ACS16_median_age ACS16_pct_white ACS16_pct_black ACS16_pct_latino  [aweight=ACS16_logpop] if RepublicanVoterShare<50 & all_at_large==1
	outreg2 using "AtLarge.doc", ctitle("Democratic Cities") alpha(.05) symbol(*) dec(2) label append	

** DV: Percent Independents		
	xi: reg percInds election_nonpartisan RepublicanVoterShare oncycle_election  f_commissioner f_council f_town ACS16_pct_homeown median_inc ACS16_pct_unempl ACS16_logpop ACS16_median_age ACS16_pct_white ACS16_pct_black ACS16_pct_latino  [aweight=ACS16_logpop] if RepublicanVoterShare>50 & all_at_large==1
	outreg2 using "AtLarge.doc", ctitle("Republican Cities") alpha(.05) symbol(*) dec(2) label append	

	xi: reg percInds election_nonpartisan RepublicanVoterShare oncycle_election  f_commissioner f_council f_town ACS16_pct_homeown median_inc ACS16_pct_unempl ACS16_logpop ACS16_median_age ACS16_pct_white ACS16_pct_black ACS16_pct_latino  [aweight=ACS16_logpop] if RepublicanVoterShare<50 & all_at_large==1
	outreg2 using "AtLarge.doc", ctitle("Democratic Cities") alpha(.05) symbol(*) dec(2) label append	
	
	
***********************
** Table A7. Alternative DV: Just Using Mayors

** Minority Party
xi: probit Repub_mayor election_nonpartisan RepublicanVoterShare oncycle_election all_at_large f_commissioner f_council f_town ACS16_pct_homeown median_inc ACS16_pct_unempl ACS16_logpop ACS16_median_age ACS16_pct_white ACS16_pct_black ACS16_pct_latino if RepublicanVoterShare>50
	outreg2 using "Mayors.doc", ctitle("Republican Cities") alpha(.05) symbol(*) dec(2) label replace

xi: probit Repub_mayor election_nonpartisan RepublicanVoterShare oncycle_election all_at_large f_commissioner f_council f_town ACS16_pct_homeown median_inc ACS16_pct_unempl ACS16_logpop ACS16_median_age ACS16_pct_white ACS16_pct_black ACS16_pct_latino if RepublicanVoterShare<50
	outreg2 using "Mayors.doc", ctitle("Democratic Cities") alpha(.05) symbol(*) dec(2) label append

** Independents
xi: probit Ind_mayor election_nonpartisan RepublicanVoterShare oncycle_election all_at_large f_commissioner f_council f_town ACS16_pct_homeown median_inc ACS16_pct_unempl ACS16_logpop ACS16_median_age ACS16_pct_white ACS16_pct_black ACS16_pct_latino if RepublicanVoterShare>50
	outreg2 using "Mayors.doc", ctitle("Republican Cities") alpha(.05) symbol(*) dec(2) label append

xi: probit Ind_mayor election_nonpartisan RepublicanVoterShare oncycle_election all_at_large f_commissioner f_council f_town ACS16_pct_homeown median_inc ACS16_pct_unempl ACS16_logpop ACS16_median_age ACS16_pct_white ACS16_pct_black ACS16_pct_latino if RepublicanVoterShare<50
	outreg2 using "Mayors.doc", ctitle("Democratic Cities") alpha(.05) symbol(*) dec(2) label append	


************************
** Table A8.  Alternative DV: Congruence (To evaluate one normative benchmark)

xi: reg congruence election_nonpartisan RepublicanVoterShare oncycle_election all_at_large f_commissioner f_council f_town ACS16_pct_homeown median_inc ACS16_pct_unempl ACS16_logpop ACS16_median_age ACS16_pct_white ACS16_pct_black ACS16_pct_latino [aweight=ACS16_logpop]if RepublicanVoterShare>50
	outreg2 using "Congruence.doc", ctitle("Republican Cities") alpha(.05) symbol(*) dec(2) label replace

xi:reg congruence election_nonpartisan RepublicanVoterShare oncycle_election all_at_large f_commissioner f_council f_town ACS16_pct_homeown median_inc ACS16_pct_unempl ACS16_logpop ACS16_median_age ACS16_pct_white ACS16_pct_black ACS16_pct_latino [aweight=ACS16_logpop]if RepublicanVoterShare<50
	outreg2 using "Congruence.doc", ctitle("Democratic Cities") alpha(.05) symbol(*) dec(2) label append


***********************
** Descriptive Statistics in Appendix
***********************

************************
**** Figure A3: Histograms of Nonpartisan v. Partisan by Type of Election

** Nonpartisan Elections: Distribution of Vote Share in the City
twoway (histogram RepublicanVoterShare if election_nonpartisan==1, frequency fcolor(black) lcolor(gs13)), subtitle(Nonpartisan Elections, size(huge)) graphregion(fcolor(white) ifcolor(white)) saving(distribution1, replace) xtitle(Partisan Leaning of City (Aggregate L2-measure), size(huge)) ytitle(Frequency, size(vlarge))

** Partisan Elections: Distribution of Vote Share in the City
twoway (histogram RepublicanVoterShare if election_nonpartisan==0, frequency fcolor(black) lcolor(gs13)), subtitle(Partisan Elections, size(huge)) graphregion(fcolor(white) ifcolor(white)) saving(distribution2, replace) xtitle(Partisan Leaning of City (Aggregate L2-measure), size(huge)) ytitle(Frequency, size(vlarge))

gr combine distribution1.gph distribution2.gph, graphregion(fcolor(white) ifcolor(white)) ysize(2) col(1) 
gr export "Distribution.png", replace

************************
** Table A2: Partisan v. Nonpartisan within States

gen Tnp_cm_count=coun_or_mayor if citytype!=""
bysort st election_nonpartisan: egen Tnp_city=total(city_count) 
bysort st election_nonpartisan: egen Tnp_coun_or_mayor=total(Tnp_cm_count) 
bysort st election_nonpartisan: gen Tnp_obs=_n
** This next Line gives the results of Table A2
gsort -election_nonpartisan st
browse st election_nonpartisan Tnp_city Tnp_coun_or_mayor if Tnp_obs==1 & election_nonpartisan!=.
drop Tnp_*
gsort state city countyprimary

***************************
** Table A3: Obs per State and Match Status

**N of cities with institutional & demo data:
qui reg election_nonpartisan RepublicanVoterShare oncycle_election all_at_large f_commissioner f_council f_town ACS16_pct_homeown median_inc ACS16_pct_unempl ACS16_logpop ACS16_median_age ACS16_pct_white ACS16_pct_black ACS16_pct_latino
gen hascitydata=1 if e(sample)
sum hascitydata


*N of mayors and councilors and cities that we have at all
sum coun_or_mayor_count if coun_or_mayor_count>0 & coun_or_mayor_count<. & citytype!=""

gen hascoun_or_mayor=0 if citytype!=""
replace hascoun_or_mayor=1 if coun_or_mayor_count>0 & coun_or_mayor_count<.& citytype!=""

*N of mayors and councilors and cities in cities where we likely have all of them
sum coun_or_mayor_count if councilonly>=3 & councilonly<. & coun_or_mayor_count>0 & citytype!=""

gen hasALLcoun_or_mayor=0 if citytype!=""
replace hasALLcoun_or_mayor=1 if councilonly>=3 & councilonly<. & coun_or_mayor_count>0 & citytype!=""

*N of mayors and councilors and cities in cities where we have city data as well
sum coun_or_mayor_count if hascitydata==1 & coun_or_mayor_count>0 & coun_or_mayor_count<. & citytype!=""

gen hascitydata_counmayor=0 if citytype!=""
replace hascitydata_counmayor=1 if hascitydata==1 & coun_or_mayor_count>0 & coun_or_mayor_count<. & citytype!=""


*N of mayors and councilors with high quality match
sum L2_coun_or_mayor_count if L2_coun_or_mayor_count>0 & L2_coun_or_mayor_count<. & citytype!=""

gen has_L2_counmayor=0 if citytype!=""
replace has_L2_counmayor=1 if L2_coun_or_mayor_count>0 & L2_coun_or_mayor_count<. & citytype!=""

*N of mayors and councilors and cities in regressions
sum L2_coun_or_mayor_count if inreg==1 & L2_coun_or_mayor_count>0 & L2_coun_or_mayor_count<. & citytype!=""

gen inreg_L2counmayor=0 if citytype!=""
replace inreg_L2counmayor=1 if inreg==1 & L2_coun_or_mayor_count>0 & L2_coun_or_mayor_count<. & citytype!=""

**ROWS showing totals for "all types" of cities in each state
	bysort st: egen T_cities=total(city_count) 
	bysort st: egen T_hascoun_or_mayor=total(hascoun_or_mayor)
	bysort st: egen T_hasALLcoun_or_mayor=total(hasALLcoun_or_mayor) 
	bysort st: egen T_has_L2_counmayor=total(has_L2_counmayor) 
	bysort st: egen T_inreg_L2counmayor=total(inreg_L2counmayor) 
	bysort st: gen T_obs=_n
	**NOTE: The following provides the numbers for the first observation of each state in Table A3, showing the total number of municipalities in each state that meet the designation in each column of Table A3
	browse st T_cities T_hascoun_or_mayor T_hasALLcoun_or_mayor T_has_L2_counmayor T_inreg_L2counmayor if T_obs==1

**ROWS showing totals for each type of municipality in each state
	bysort st citytype: egen Tct_cities=total(city_count) if citytype!=""
	bysort st citytype: egen Tct_hascoun_or_mayor=total(hascoun_or_mayor) if citytype!=""
	bysort st citytype: egen Tct_hasALLcoun_or_mayor=total(hasALLcoun_or_mayor) if citytype!=""
	bysort st citytype: egen Tct_has_L2_counmayor=total(has_L2_counmayor) if citytype!=""
	bysort st citytype: egen Tct_inreg_L2counmayor=total(inreg_L2counmayor) if citytype!=""
	bysort st citytype: gen Tct_obs=_n
	**NOTE: The following provides the numbers for the 2nd observation and on up of each state in Table A3, showing the total number of municipalities by municipality type (e.g., city, town, village, etc.) in each state that meet the designation in each column of Table A3
	browse st citytype Tct_cities Tct_hascoun_or_mayor Tct_hasALLcoun_or_mayor Tct_has_L2_counmayor Tct_inreg_L2counmayor if Tct_obs==1 & citytype!=""

*ROWS showing totals for "all types" of municipalities in the entire US
	egen TctUS_cities=total(city_count) if st!="HI"
	egen TctUS_hascoun_or_mayor=total(hascoun_or_mayor) if st!="HI"
	egen TctUS_hasALLcoun_or_mayor=total(hasALLcoun_or_mayor) if st!="HI"
	egen TctUS_has_L2_counmayor=total(has_L2_counmayor) if st!="HI"
	egen TctUS_inreg_L2counmayor=total(inreg_L2counmayor) if st!="HI"
	gen TctUS_obs=_n
	**NOTE: The following provides the numbers for the 1st observation for the entire US in Table A3, showing the total number of municipalities that meet the designation in each column of Table A3
	browse TctUS_cities TctUS_hascoun_or_mayor TctUS_hasALLcoun_or_mayor TctUS_has_L2_counmayor TctUS_inreg_L2counmayor if TctUS_obs==1 

	drop TctUS_*

*ROWS showing totals for "all types" of municipalities in the entire US exluding Minor Civil Divisions in MI, MN, and WI

	*IDENTIFY municipalities that are Minor Civil Divisions in MI, MN, and WI
	gen missingMCDs=0
	replace missingMCDs=1 if st=="MI" & citytype=="township"
	replace missingMCDs=1 if st=="MI" & citytype=="charter township"
	replace missingMCDs=1 if st=="MN" & citytype=="township"
	replace missingMCDs=1 if st=="WI" & citytype=="town"

	egen TctUS_cities=total(city_count) if st!="HI" & missingMCDs==0
	egen TctUS_hascoun_or_mayor=total(hascoun_or_mayor) if st!="HI" & missingMCDs==0
	egen TctUS_hasALLcoun_or_mayor=total(hasALLcoun_or_mayor) if st!="HI" & missingMCDs==0
	egen TctUS_has_L2_counmayor=total(has_L2_counmayor) if st!="HI" & missingMCDs==0
	egen TctUS_inreg_L2counmayor=total(inreg_L2counmayor) if st!="HI" & missingMCDs==0
	gen TctUS_obs=_n
	**NOTE: The following provides the numbers for the for the 2nd observation of the entire US in Table A3, showing the total number of municipalities excluding Minor Civil Divisions in MI, MIN, and WI that meet the designation in each column of Table A3
	browse TctUS_cities TctUS_hascoun_or_mayor TctUS_hasALLcoun_or_mayor TctUS_has_L2_counmayor TctUS_inreg_L2counmayor if TctUS_obs==1 

	drop TctUS_*

**ROWS showing totals for each type of municipality in the entire US
	bysort citytype: egen TctUS_cities=total(city_count) if citytype!="" & st!="HI"
	bysort citytype: egen TctUS_hascoun_or_mayor=total(hascoun_or_mayor) if citytype!="" & st!="HI"
	bysort citytype: egen TctUS_hasALLcoun_or_mayor=total(hasALLcoun_or_mayor) if citytype!="" & st!="HI"
	bysort citytype: egen TctUS_has_L2_counmayor=total(has_L2_counmayor) if citytype!="" & st!="HI"
	bysort citytype: egen TctUS_inreg_L2counmayor=total(inreg_L2counmayor) if citytype!="" & st!="HI"
	bysort citytype: gen TctUS_obs=_n
	**NOTE: The following provides the numbers for each type of municipality (e.g., city, town, village, etc.) across the entire US that meet the designation in each column of Table A3
	browse citytype TctUS_cities TctUS_hascoun_or_mayor   TctUS_hasALLcoun_or_mayor TctUS_has_L2_counmayor TctUS_inreg_L2counmayor if TctUS_obs==1 & citytype!=""

	drop T_* Tct_* TctUS_* missingMCDs

	**NOTE: The following provides the number of states with each type of municipality (e.g., city, town, village, etc.) across the entire US as showing in Table A3 (in the US section of the table). Please note that the "city-county" type is the sum of states with either a "borough", "city and borough", "consolidated government", "county", "metro government", "unified government", and "urban county" type of municipality.

	tab st if citytype=="borough"
	tab st if citytype=="charter township"
	tab st if citytype=="city"
	tab st if citytype=="city and borough"
	tab st if citytype=="consolidated government"
	tab st if citytype=="corporation"
	tab st if citytype=="county"
	tab st if citytype=="independent city"
	tab st if citytype=="metro government"
	tab st if citytype=="metropolitan government"
	tab st if citytype=="municipality"
	tab st if citytype=="plantation"
	tab st if citytype=="town"
	tab st if citytype=="township"
	tab st if citytype=="unified government"
	tab st if citytype=="urban county"
	tab st if citytype=="village"


************************
** Figure A1 Density plot of population by sample status
	twoway (kdensity ACS16_logpop if citytype!="", lcolor(gs10) lpattern(shortdash)) (kdensity ACS16_logpop if hascoun_or_mayor==1, lcolor(gs10) lpattern(solid)) (kdensity ACS16_logpop if inreg_L2counmayor==1, lcolor(black) lpattern(solid)), name(logpop_by_sample, replace) legend(label(1 "All Municipalities") label(2 "Munic. w/ Official") label(3 "Munic. in" "Regression")) xlabel(2.30258509299 "10" 3.91202300543 "50" 4.6052 "100" 6.21460809842 "500" 6.9078 "1k" 8.5172 "5k" 9.2103 "10k" 10.8198 "50k" 11.5129 "100k" 13.1224 "500k" 13.8155 "1M" 15.4249 "5M", angle(vertical) grid) ytitle("Density") xtitle("Municipal Population 2016, logged scale") 

	graph export "Logpop_by_sample.pdf", name(logpop_by_sample) replace


